package pcsr.hwVirtualization;

import java.util.Collection;

/**
 * The class <code>Robot</code> implements this interface in order to define the contract to be used when subscribing to a PCSR managed robot.
 * 
 * @author Paulo Fagundes
 *
 * @see Robot
 * @see IRobotObserver
 * @see Actuator
 * @see Sensor
 */
public interface IRobotObservable {

	/**
	 * Subscribe notifications about robot changes.
	 * @param observer The subscriber of notifications.
	 * @return The success of the operation. <code>True</code> if succeed, <code>False</code> otherwise.
	 * @see IRobotObserver
	 */
	boolean ObserveRobot( final IRobotObserver observer );	
	
	/**
	 * Cancel subscription of notifications about robot changes.
	 * @param observer The subscriber that is canceling.
	 * @return The success of the operation. <code>True</code> if succeed, <code>False</code> otherwise.
	 * @see IRobotObserver 
	 */
	boolean UnObserveRobot( final IRobotObserver observer );
	
	/**
	 * Gets all sensors from the robot that are managed by PCSR.
	 * @return Collection of <code>Sensor</code>s
	 * @see Sensor
	 */
	Collection<Sensor> GetAllSensors( );
	
	/**
	 * Gets all actuators from the robot that are managed by PCSR.
	 * @return Collection of <code>Actuator</code>s
	 * @see Actuator
	 */
	Collection<Actuator> GetAllActuators( );

	/**
	 * Gets information about the robot.
	 * @return Information about the robot.
	 * @see RobotInfo
	 */
	RobotInfo GetRobotInfo();
	
}
